//
//  UpdataDetailViewController.m
//  DaysComicSugar
//
//  Created by dllo on 15/4/23.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "UpdataDetailViewController.h"
#import "UIImageView+WebCache.h"
@interface UpdataDetailViewController ()

@end

@implementation UpdataDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor=[UIColor colorWithRed:220/255.0 green:220/255.0 blue:220/255.0 alpha:1];
    self.myImageView=[[UIImageView alloc]init];
            [self.view addSubview:self.myImageView];
    self.myImageView.backgroundColor=[UIColor greenColor];
            [self.myImageView release];

            self.titleLbael=[[UILabel alloc]init];
            [self.view addSubview:self.titleLbael];
    self.titleLbael.text=self.updateDetail.bookName;
            [self.titleLbael release];

            self.typeLabel=[[UILabel alloc]init];
            [self.view addSubview:self.typeLabel];
    self.typeLabel.text=self.updateDetail.catalogName;

            [self.typeLabel release];
    
    NSURL *url=[NSURL URLWithString:self.updateDetail.bookIconOtherURL];
    [self.myImageView sd_setImageWithURL:url];
    [self.view addSubview:self.myImageView];
    [self.myImageView release];
    
            self.authorButton=[UIButton buttonWithType:UIButtonTypeSystem];
            [self.authorButton addTarget:self action:@selector(author:) forControlEvents:UIControlEventTouchUpInside];
            [self.authorButton setTitle:self.updateDetail.bookAuthor forState:UIControlStateNormal];
    [self.view addSubview:self.authorButton];
    self.authorButton.tintColor = [UIColor redColor];
//    self.authorButton.backgroundColor=[UIColor redColor];

            self.moodsLabel=[[UILabel alloc]init];
            [self.view addSubview:self.moodsLabel];
    self.moodsLabel.text=[NSString stringWithFormat:@"%ld",self.updateDetail.bookClickCount];
            [self.moodsLabel release];

            self.updateLabel=[[UILabel alloc]init];
            [self.view addSubview:self.updateLabel];
    self.updateLabel.text =self.updateDetail.bookUpdateDate;
            [self.updateLabel release];
    
            self.serializeLabel=[[UILabel alloc]init];
            [self.view addSubview:self.serializeLabel];
    self.serializeLabel.text=self.updateDetail.bookStateName;
            [self.serializeLabel release];

            self.abstractLabel=[[UILabel alloc]init];
            [self.view addSubview:self.abstractLabel];
    self.abstractLabel.text=self.updateDetail.bookDescription;
    self.abstractLabel.numberOfLines=12;
    [self.abstractLabel sizeToFit];
    self.abstractLabel.font=[UIFont systemFontOfSize:12];
            [self.abstractLabel release];

        self.myImageView.frame=CGRectMake(10, 90, 110, 155);
        self.titleLbael.frame=CGRectMake(130, 70, 200, 40);
    self.titleLbael.font=[UIFont systemFontOfSize:20];
        UILabel *Type=[[UILabel alloc]initWithFrame:CGRectMake(130, 110, 100, 20)];
        Type.text=@"所属类型:";
        [self.view addSubview:Type];
        [Type release];
        self.typeLabel.frame=CGRectMake(240, 110, 100, 20);
    
        UILabel *author=[[UILabel alloc]initWithFrame:CGRectMake(130, 140, 100, 20)];
        author.text=@"作  者:";
        [self.view addSubview:author];
        [author release];
        self.authorButton.frame=CGRectMake(220, 140, 100, 20);
    
        UILabel *moods=[[UILabel alloc]initWithFrame:CGRectMake(130, 170, 100, 20)];
        moods.text=@"人  气:";
        [self.view addSubview:moods];
        [moods release];
        self.moodsLabel.frame=CGRectMake(240, 170, 100, 20);
    
        UILabel *update=[[UILabel alloc]initWithFrame:CGRectMake(130, 200, 100, 20)];
        update.text=@"最近更新:";
        [self.view addSubview:update];
        [update release];
        self.updateLabel.frame=CGRectMake(240, 200, 100, 20);
    
        UILabel *serialize=[[UILabel alloc]initWithFrame:CGRectMake(130, 230, 100, 20)];
        serialize.text=@"连载状态:";
        [self.view addSubview:serialize];
        [serialize release];
        self.serializeLabel.frame=CGRectMake(240, 230, 100, 20);
        
//        UILabel *abstract=[[UILabel alloc]initWithFrame:CGRectMake(20, 300, 130, 50)];
//        abstract.text=@"漫画简介";
//        [self.view addSubview:abstract];
//        [abstract release];
        self.abstractLabel.frame=CGRectMake(30, 280, 320, 200);
    
    UIButton *collectBU=[UIButton buttonWithType:UIButtonTypeSystem ];
    collectBU.frame=CGRectMake(60, 252, 80, 40);
    [collectBU setTitle:@"收  藏" forState:UIControlStateNormal ];
    [collectBU addTarget:self action:@selector(collecting:) forControlEvents:UIControlEventTouchUpInside];
    collectBU.layer.cornerRadius=5;
    collectBU.tintColor=[UIColor whiteColor];
   
    [self.view addSubview:collectBU];
//    collectBU setBackgroundColor:(UIColor colorWithRed:67 green:134 blue:223 alpha:1);
    [collectBU setBackgroundColor:[UIColor colorWithRed:78/255.0 green:143/255.0 blue:223/255.0 alpha:1]];
    UIButton *abstractBU=[UIButton buttonWithType:UIButtonTypeSystem ];
    abstractBU.frame=CGRectMake(200, 252, 80, 40);
    [abstractBU setTitle:@"漫画简介" forState:UIControlStateNormal ];
    [abstractBU addTarget:self action:@selector(abstracting:) forControlEvents:UIControlEventTouchUpInside];
//    abstractBU.tintColor=[UIColor redColor];
    abstractBU.layer.cornerRadius=5;
 
   [abstractBU setBackgroundColor:[UIColor colorWithRed:78/255.0 green:143/255.0 blue:223/255.0 alpha:1]];
    abstractBU.tintColor=[UIColor whiteColor];
    [self.view addSubview:abstractBU];
    UILabel *station=[[UILabel alloc]initWithFrame:CGRectMake(30, 450, 100, 30)];
    station.text=@"资源站点";
    [self.view addSubview:station];
    [station release];
    
}
-(void)pull:(UIButton *)bu{
    self.abstractLabel.frame=CGRectMake(30, 240, 320, 100);
    
}
-(void)author:(UIButton *)bu{

    
}
-(void)collecting:(UIButton *)bu{
    
}
-(void)abstracting:(UIButton *)bu{
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
